<template>
  <div class="step-item-ind" :class="stepClass">
    <template v-if="option">
      <div class="step-content">
        <div class="left">
          <span class="num-tag">{{ option.num }}</span>
        </div>
        <div class="right">
          <div class="main-title">{{ option.title }}</div>
          <div class="sub-title">{{ option.subTitle }}</div>
        </div>
      </div>
    </template>
  </div>
</template>

<script>
export default {
  name: 'StepItemInd',
  props: {
    option: {
      type: Object,
      default: () => ({
        num: null,
        title: null,
        subTitle: null,
      }),
    },
    actived: {
      type: Boolean,
      default: false,
    },
    passed: {
      type: Boolean,
      default: false,
    },
    arrived: {
      type: Boolean,
      default: false,
    },
  },
  data() {
    return {}
  },
  computed: {
    stepClass: function () {
      if (this.actived) {
        return 'actived'
      }
      if (this.passed) {
        return 'passed'
      }
      if (this.arrived) {
        return 'arrived'
      }
      return 'unpass'
    },
  },
  methods: {},
}
</script>

<style lang="scss" scoped>
.step-item-ind {
  display: flex;
  align-items: center;
  justify-content: center;
  &.arrived {
    cursor: pointer;
    .step-content {
      .left {
        background: #2672ff;
        color: #fff;
      }
      .right {
        background: #e2ecff;
        color: #2672ff;
      }
    }
  }
  &.passed {
    cursor: pointer;
    .step-content {
      .left {
        background: #2672ff;
        color: #fff;
      }
      .right {
        background: #e2ecff;
        color: #2672ff;
      }
    }
  }
  &.actived {
    .step-content {
      height: 60px;
      box-shadow: 0px 4px 8px -2px rgba(70, 66, 59, 0.6);
      .left {
        background: #2672ff;
        color: #fff;
        width: 60px;
        .num-tag {
          font-size: 30px;
        }
      }
      .right {
        background: #e2ecff;
        width: 260px;
        color: #2672ff;
        .main-title {
          font-weight: bold;
          font-size: 20px;
        }
        .sub-title {
          display: block;
        }
      }
    }
  }
  .step-content {
    display: flex;
    align-items: center;
    background: #d7d5d2;
    height: 40px;
    border-radius: 4px;
    overflow: hidden;
    transition: 0.3s;
    .left {
      width: 40px;
      height: 100%;
      min-width: 40px;
      background: #cccac7;
      color: #635e59;
      display: flex;
      justify-content: center;
      align-items: center;
      img {
        height: 16px;
      }
      .num-tag {
        font-size: 20px;
      }
    }
    .right {
      padding-left: 18px;
      width: 200px;
      height: 100%;
      background: #d7d5d2;
      color: #635e59;
      display: flex;
      flex-direction: column;
      justify-content: center;
      .main-title {
        font-size: 18px;
      }
      .sub-title {
        font-size: 12px;
        display: none;
        margin-top: 5px;
      }
    }
  }
}
</style>
